#!/usr/bin/python
# Filename: 21.py
import urllib
import os, sys
path_sep = os.sep
pwd = sys.path[0]+path_sep
url = 'http://butter:fly@www.pythonchallenge.com/pc/hex/unreal.jpg'

##Private info found
# for i in range(30203, 30500):
	# opener = urllib.FancyURLopener()
	# opener.addheader("range", "bytes=%d-" % i)
	# info = opener.open(url).read()
	# info = f.read()
	# if(len(info) > 1): 
		# print "i = %d, info = %s" %(i, info),
# for i in xrange(2123456789, 2123456788, -1):
	# opener = urllib.URLopener()
	# opener.addheader("range", "bytes=%d-" %i)
	# info = opener.open(url).read()
	# if(len(info) > 1):
		# print "i = %d, info = %s" %(i, info[::-1]),

opener = urllib.URLopener()
opener.addheader("range", "bytes=%d-" %(1152983631))
info = opener.open(url).read()
open(pwd+"output"+path_sep+"21.zip", "wb").write(info)
# nickname: invader
# print info[:20]
# print [c for c in info[:20]]

